package com.ctu.study
{
	import mx.core.UIComponent;
	import flash.text.engine.*;


	public class ElementFormatExample extends UIComponent
	{
		public function ElementFormatExample()
		{
			var fd:FontDescription = new FontDescription();
            fd.fontName = "Garamond";
            fd.fontWeight = flash.text.engine.FontWeight.BOLD;

            var ef1:ElementFormat = new ElementFormat(fd);
            ef1.fontSize = 30;
            ef1.color = 0xFF0000;
            ef1.alpha = 100;
            ef1.kerning = flash.text.engine.Kerning.ON;
            ef1.trackingRight = 2;
            ef1.typographicCase = flash.text.engine.TypographicCase.UPPERCASE;
            ef1.alignmentBaseline = flash.text.engine.TextBaseline.DESCENT;
            ef1.ligatureLevel = flash.text.engine.LigatureLevel.EXOTIC;
            
            var ef2:ElementFormat = new ElementFormat(fd);
            ef2.fontSize = 30;
            ef2.color = 0xFF0000;
            ef2.alpha = 0.3;
            ef2.kerning = flash.text.engine.Kerning.ON;
            ef2.trackingRight = 10;
            ef2.typographicCase = flash.text.engine.TypographicCase.UPPERCASE;
            //ef2.digitCase = flash.text.engine.DigitCase.OLD_STYLE;
            //ef2.textRotation = flash.text.engine.TextRotation.ROTATE_270;
            
            var str:String = "This is flash text 0123456789";
            var tb:TextBlock = new TextBlock();
            var te1:TextElement = new TextElement(str, ef1);
            tb.content = te1;
            var line1:TextLine = tb.createTextLine(null, 600);
            addChild(line1);
            line1.x = 0;
            line1.y = 30;

            tb.content.elementFormat = ef2;
            var line2:TextLine = tb.createTextLine(null, 600);
            addChild(line2);
            line2.x = 0;
            line2.y = 60;

		}
		
	}
}